package com.aaa.controller.tables;

import com.aaa.entity.Type;
import com.aaa.service.impl.TypeService;
import com.aaa.service.impl.TypeServiceImpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("type")
public class TypeController {
    @Resource
    TypeServiceImpl typeService1;
    @Resource
    TypeService typeService2;
    @RequestMapping("select")
    public Object select(){
        return typeService1.select();
    }
    @RequestMapping("insert")
    public Integer insert(Type type){
        return typeService1.insert(type);
    }
    @RequestMapping("delete")
    public Integer delete(Integer tid){
        return typeService1.delete(tid);
    }
    @RequestMapping("update")
    public Integer update(Type type){
        return typeService1.update(type);
    }
    @RequestMapping("select2")
    public Object select2(Integer pageCode,Integer pageSize,Type type){
        return typeService2.pages(pageCode,pageSize,type);
    }
}
